package com.blq.web.service;

import com.alibaba.fastjson.JSONObject;
import com.blq.common.core.domain.entity.SysDept;
import com.blq.common.core.domain.entity.SysUser;
import com.blq.web.domain.UserMoneyItem;
import com.blq.web.domain.vo.UserMoneyItemVo;
import com.blq.web.domain.bo.UserMoneyItemBo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.blq.common.core.page.TableDataInfo;
import com.blq.common.core.domain.PageQuery;

import java.math.BigDecimal;
import java.util.Collection;
import java.util.List;

/**
 * 钱包明细Service接口
 *
 * @author zeh
 * @date 2023-06-25
 */
public interface IUserMoneyItemService extends IService<UserMoneyItem> {

    /**
     * 查询钱包明细
     */
    UserMoneyItemVo queryById(Long itemId);

    /**
     * 查询钱包明细列表
     */
    TableDataInfo<UserMoneyItemVo> queryPageList(UserMoneyItemBo bo, PageQuery pageQuery);

    /**
     * 查询钱包明细列表
     */
    List<UserMoneyItemVo> queryList(UserMoneyItemBo bo);

    TableDataInfo<UserMoneyItemVo> queryPageBankList(UserMoneyItemBo bo, PageQuery pageQuery);

    boolean handleBankCash(UserMoneyItemBo bo);

    /**
     * 修改钱包明细
     */
    Boolean insertByBo(UserMoneyItemBo bo);

    /**
     * 修改钱包明细
     */
    Boolean updateByBo(UserMoneyItemBo bo);

    /**
     * 校验并批量删除钱包明细信息
     */
    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);

    JSONObject queryTotalAndFreeze(Long objId);

    boolean cashMoneys(Long objId, BigDecimal money, Integer classify);

    boolean bankCash(SysUser sysUser, BigDecimal money, Integer classify);

    boolean bankCash(SysDept sysDept, BigDecimal money, Integer classify);

    boolean zfbCash(SysUser sysUser, BigDecimal money, Integer classify, Integer type, Long itemId);

    boolean zfbCash(SysDept sysDept, BigDecimal money, Integer classify, Integer type, Long itemId);

    boolean wxCash(SysUser sysUser, BigDecimal money, Integer classify, Integer type);
}
